<?php


namespace app\controller;
use app\BaseController;
use app\service\DashBoardService;
use think\App;
use think\facade\Request;


class DashBoard extends BaseController
{

    public $service;
    protected $request;


    public function __construct(App $app, DashBoardService $service, Request $request)
    {
        parent::__construct($app);
//        parent::initialize();
        $this->service = $service;
        $this->request = $request;
    }
    /** 大屏数据统计
     * @return
     */
    public function DashboardStatistical()
    {

        $params = $this->params;

        // 默认浙江区域（总部）
        $params['region_id'] = isset($params['region_id']) && $params['region_id'] ? $params['region_id'] : 1;


        $result = $this->service->DashboardStatistical($params);
        return json(['code' => 200, 'msg' => '数据获取成功', 'data' => $result]);

    }
}
